#!/usr/bin/env python
import tornado.database
from tornado.options import define, options

define("mysql_host", default="127.0.0.1:3306")
define("mysql_database", default="promise")
define("mysql_user", default="root")
define("mysql_password", default="123456")

db = tornado.database.Connection(
    host = options.mysql_host,database = options.mysql_database,
    user = options.mysql_user,password = options.mysql_password)

users = db.query("select * from users")
for u in users:
    print u
